(require 'org-install)
(require 'org-publish)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock)
(add-hook 'org-mode-hook 
(lambda () (setq truncate-lines nil)))
 
;;(setq org-hide-leading-stars t)
(setq org-log-done t)

(setq org-publish-project-alist
      '(("note-org"
         :base-directory "~/.emacs.d/mi-emacs/docs/org"
         :publishing-directory "~/.emacs.d/mi-emacs/docs/publish"
         :base-extension "org"
         :recursive t
         :publishing-function org-publish-org-to-html
         :auto-index nil
         :index-filename "index.org"
         :index-title "index"
         :link-home "index.html"
         :section-numbers nil
         :style "<link rel=\"stylesheet\"
    href=\"./style/emacs.css\"
    type=\"text/css\"/>")
        ("note-static"
         :base-directory "~/.emacs.d/mi-emacs/docs/org"
         :publishing-directory "~/.emacs.d/mi-emacs/docs/publish"
         :recursive t
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
         :publishing-function org-publish-attachment)
        ("note" 
         :components ("note-org" "note-static")
         :author "cutemiex@gmail.com"
         )))

(setq org-todo-keywords
  '((sequence "TODO" "STARTED" "WAITING" "DELEGATED" "REVIEW" "|" "DEFERRED"  "CANCELLED"  "DONE")
   )) 

(setq org-tag-alist
     '(("FAMILY" . ?f)  ("OFFICE" . ?o)   ("LEARNING" . ?l) 
       ("URGENT" . ?u)  ("EASY" . ?e)    ("COMMON" . ?c)   ("HARD" . ?h) 
       ("WEEK" . ?w)    ("DAILY" . ?d)    ("MONTH" . ?m) ("ANY TIME" . ?a)))


(custom-set-variables 
 '(org-agenda-files (quote ("~/.emacs.d/mi-emacs/docs/org/todo.org")))
 '(org-default-notes-file "~/.emacs.d/mi-emacs/docs/org/notes.org")
 '(org-agenda-ndays 7)
 '(org-deadline-warning-days 14)
 '(org-agenda-show-all-dates t)
 '(org-agenda-skip-deadline-if-done t)
 '(org-agenda-skip-scheduled-if-done t)
 '(org-agenda-start-on-weekday nil)
 '(org-reverse-note-order t)
 '(org-agenda-custom-commands
   (quote (("d" todo "DELEGATED" nil)
       ("c" todo "DONE|DEFERRED|CANCELLED" nil)
       ("w" todo "WAITING" nil)
       ("W" agenda "" ((org-agenda-ndays 21)))
       ("A" agenda ""
        ((org-agenda-skip-function
          (lambda nil
        (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]")))
         (org-agenda-ndays 1)
         (org-agenda-overriding-header "Today's Priority #A tasks: ")))
       ("u" alltodo ""
        ((org-agenda-skip-function
          (lambda nil
        (org-agenda-skip-entry-if (quote scheduled) (quote deadline)
                      (quote regexp) "\n]+>")))
         (org-agenda-overriding-header "Unscheduled TODO entries: "))))))
 '(org-remember-store-without-prompt t)
 '(org-remember-templates
    (quote ((116 "* TODO %?\n  %u" "~/.emacs.d/mi-emacs/docs/org/todo.org" "Tasks")
       (110 "* %u %?" "~/.emacs.d/mi-emacs/docs/org/notes.org" "Notes")
       (115 "* %u %?" "~/.emacs.d/mi-emacs/docs/org/someday.org" "Someday")
  )))
)

(org-remember-insinuate)

(defun mytodo ()
   (interactive)
   (find-file "~/.emacs.d/mi-emacs/docs/org/todo.org"))
